package com.ssn.observer.stock;

public class Client {
    public static void main(String[] args) {
        Stock one = new Stock("S1");
        Stock two = new Stock("S2");

        Observer ming = new User("小明");
        Observer hong = new User("小红");
        Observer hei = new User("小黑");

        one.attach(ming);
        one.attach(hei);
        two.attach(hong);

        // one原价是100
        one.setNow(101);
        one.setNow(150);
        // two 原价是200
        two.setNow(199);
        two.setNow(170);
    }
}
